package test19.transformation;

import java.io.*;

public class InputStreamReader_ {
    public static void main(String[] args) throws IOException {
        String filePath = "D:\\a.txt";
        String data = "";
        //1. 把 FileInputStream 转成 InputStreamReader,指定编码 gbk
        InputStreamReader gbk = new InputStreamReader(new FileInputStream(filePath), "gbk");
        //把 InputStreamReader 传入 BufferedReader
        BufferedReader bufferedReader = new BufferedReader(gbk);
        while((data=bufferedReader.readLine()) != null){
            System.out.println(data);
        }
        bufferedReader.close();
    }
}
